package org.fast.develop.logicflow.core.meta.shape.line;

import org.fast.develop.logicflow.core.meta.base.Ref;
import org.fast.develop.logicflow.core.meta.base.Resource;
import org.fast.develop.logicflow.core.meta.base.line.Line;
import org.fast.develop.logicflow.core.meta.condition.ConditionExpression;
import org.fast.develop.logicflow.core.meta.shape.properties.SequenceFlowProperties;

/**
 * @author 莫寅
 * @createTime 2022-11-23 01:51
 * @desc：
 */
public class SequenceFlow extends Resource<SequenceFlowProperties> implements Line {

    private ConditionExpression condition;

    private Boolean isDefault = false;

    private Ref sourceRef;
    private Ref targetRef;

    public ConditionExpression getCondition() {
        return condition;
    }

    public void setCondition(ConditionExpression condition) {
        this.condition = condition;
    }

    public Ref getSourceRef() {
        return sourceRef;
    }

    public void setSourceRef(Ref sourceRef) {
        this.sourceRef = sourceRef;
    }

    public Ref getTargetRef() {
        return targetRef;
    }

    public void setTargetRef(Ref targetRef) {
        this.targetRef = targetRef;
    }

    public Boolean getDefault() {
        return isDefault;
    }

    public void setDefault(Boolean aDefault) {
        isDefault = aDefault;
    }

    @Override
    public String toString() {

        return "SequenceFlow{" +
                "resourceId='" + getResourceId() + '\'' +
                ", condition=" + condition +
                ", sourceRef=" + sourceRef +
                ", targetRef=" + targetRef +
                '}';
    }

    @Override
    public Class<SequenceFlowProperties> getPropertiesClass() {
        return SequenceFlowProperties.class;
    }
}
